Skip to content

fix(studio): an unsealed recording on an empty timeline records up to the composition's end - #8606

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/unsealed-recording-on-empty-timeline
Nov 23, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/unsealed-recording-on-empty-timeline

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What

In the open (unsealed) preview, recording a gesture on a composition whose own GSAP timeline is empty now records over time and saves its keyframes. Before, the playhead never left 0:00 while recording and nothing was saved. The sealed preview already did this. This changes what unsealed saves on such compositions: a recording there now writes keyframes where it wrote none.

Why

A composition can hold its layers with gsap.set outside its timeline, so the timeline itself has no length. The unsealed recorder capped the recording's time at that timeline's length (maxSeekTime from tl.duration() in connectGsapRuntime), which is 0, so every sample landed at 0 s and the commit had nothing to save. The sealed recorder caps at the layer's end within the composition's duration, from the player store, and records fine.

Related work

Found while live-checking #8568 on 0.9.86 (the edit bench's hold case: sealed saved, unsealed didn't).

How

useGestureRecording.ts computes the recording's end once, Math.min(elementEnd, the composition's duration), and both modes use it: the unsealed runtime's seek cap and the sealed playhead. The unsealed runtime no longer reads its timeline's own length.

Before

Unsealed, published 0.9.86, the bench's hold case, after recording a move: the playhead is still at 0:00, and nothing was saved.

Before: unsealed, after recording, the playhead is still at 0:00

After

Same recording on this branch: the playhead reached 0:03, and the saved keyframes start at the layer's GSAP offset, as sealed's do.

After: unsealed, after recording, the playhead reached 0:03

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

fails without the fix:

  • packages/studio/src/hooks/useGestureRecording.sealed.test.tsx: "records over time unsealed, up to the layer's end within the film", "records the same samples sealed and unsealed".

  • With the fix, that file, useGestureRecording.test.tsx and useGestureCommit.test.tsx pass three runs in a row on Linux (32 tests). Studio's src/hooks (184 files, 1,973 tests) passes, and Studio typechecks clean.

  • In Studio built at this branch on Linux, headless, on the bench's hold case (GSAP holds the layer at x 40, y 20; the timeline is otherwise empty): unsealed now saves keyframes starting "0%": { x: 40, y: 20 }, and sealed (frame origin null) saves keyframes starting the same way. On published 0.9.86, unsealed saved nothing there.

Before: unsealed, after recording, the playhead is still at 0:00

After: unsealed, after recording, the playhead reached 0:03

@terencecho terencecho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unsealed recorder now uses the same composition and layer bounds as sealed, so an empty GSAP timeline can record over time. All 32 focused tests passed. With the previous implementation restored locally, both named regression tests failed as expected. The last unsealed sample was at 0 s instead of 0.5 s.

— tai (automated review)

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 72 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 4f863db Nov 23, 2026
152 of 154 checks passed
@miguel-heygen
miguel-heygen deleted the fix/unsealed-recording-on-empty-timeline branch November 23, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants